<script>
    var index = parent.layer.getFrameIndex(window.name);
    $(function () {
        pageInit()
    });

    function pageInit() {
        validateInfo();
    }

    function validateInfo() {
        var $thisForm = $('#thisForm');
        $thisForm.sdvalidate({
            rules: {
            },
            submitHandler: function (form) {
                var url = window.location.href;
                var params = $thisForm.serialize();
                console.log(params)
                $.sdpost(url, params, function (res) {
                    if (res.code === 0) {
                        parent.layer.msg(res.msg);
                        parent.refresh();
                        parent.layer.close(index)
                    } else {
                        parent.layer.alert(res.msg, {icon: 2, title: '失败'})
                    }
                });
                return false
            }
        });
    }

    function FormSubmit() {
        $('#thisForm').submit();
    }
</script>